package com.algrithom.pointer;

/**
 * 557. 反转字符串中的单词 III
 * 
 * @author think
 */
public class Solution7 {
    
    public static void main(String[] args){
        Solution7 solution7 = new Solution7();
        System.out.println(solution7.reverseWords(""));
    }
    
    public String reverseWords(String s){
        String[] str = s.split(" ");
        StringBuilder ans = new StringBuilder();
        for (String value : str) {
            ans.append(" ").append(new StringBuilder(value).reverse());
        }
        ans.delete(0,1);
        return ans.toString();
    }
}
